package MethodReference.练习;

import java.util.ArrayList;
import java.util.Collections;

public class 练习一 {
    public static void main(String[] args) {
        /*
        需求:
        集合中存储一些字符串的数据
        收集到Student类型的数组当中
         */
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"张无忌-23","李四-32","张强-64","张三丰-23","王五-65","克莱普-21","谢广坤-17");

        StudentOne[] array = list.stream()
                //封装到StudentOne当中
                .map(StudentOne::new)
                //转换成对应对类型（数组）
                .toArray(StudentOne[]::new);

        for (StudentOne studentOne : array) {
            System.out.println(studentOne);
        }
    }
}
